package kr.hkit.powerjava.chapter06;

public class GugudanFor {
	public static void main(String[] args) {

		/*
		 * for (int i=2;i<10;i++){
		 * System.out.printf("%2d * %2d = %2d\n",2,i,2*i); }
		 */

		/*
		 * caLGuguDan(i); }
		 */
		// caLGuGuDans();

		// calfact(5);

		// prnstar();

		// caLGuGuDans(5);

		 //prnstars();
		prntristars();

	}

	private static void prntristars() {
		for (int i = 6; i > 0; i--) {
			for (int j = 0; j < i - 1; j++) {

				System.out.print(" ");
			}

			for (int j = i; j < 6; j++) {

				System.out.print("*");

			}
			System.out.println();
		}

	}


	
	
	private static void prnstars() {

		for (int i = 0; i < 6; i++) {
			for (int q = 6; q > i; q--) {

				System.out.print(" ");
			}
			for (int j = 0; j < i + 1; j++) {
				System.out.print("*");

			}
			System.out.println();
		}

	}

	private static void caLGuGuDans(int dan) {
		for (int i = 1; i < 10; i++) {
			if (i == 5)
				continue;
			System.out.printf("%2d * %2d = %2d\n", dan, i, dan * i);
		}
		System.out.println();
		// TODO Auto-generated method stub

	}

	private static void prnstar() {
		for (int j = 0; j < 10; j++) {
			for (int i = 0; i < 10; i++) {
				System.out.print("*");

			}
			System.out.println();
		}
	}

	private static void calfact(int i) {
		int fact = 1;

		for (int j = 1; j < i + 1; j++) {
			fact = fact * j;
		}
		System.out.println(i + "! = " + fact);
		// TODO Auto-generated method stub

	}

	private static void caLGuGuDans() {
		for (int dan = 2; dan < 10; dan++) {
			for (int i = 1; i < 10; i++) {
				System.out.printf("%2d * %2d = %2d\n", dan, i, dan * i);
			}
			System.out.println();
		}
		// TODO Auto-generated method stub

	}

	private static void caLGuguDan(int dan) {
		for (int i = 1; i < 10; i++) {
			System.out.printf("%2d * %2d = %2d\n", dan, i, dan * i);

			// TODO Auto-generated method stub

		}

	}
}
